package com.zxstudio.bulls.stock.entity.user;

import com.zxstudio.bulls.stock.entity.base.BaseEntity;
import com.zxstudio.bulls.stock.entity.vo.AuthorityMenuOperationVo;
import lombok.Data;
import org.hibernate.annotations.NotFound;
import org.hibernate.annotations.NotFoundAction;

import javax.persistence.*;

@Entity
@Table(name= "t_authority_role_operation")
@Data
@NamedEntityGraph(name = "AuthorityRoleOperation.fullMenuOperation", attributeNodes = {@NamedAttributeNode("authorityMenuOperationVo")})
public class AuthorityRoleOperation extends BaseEntity {
    /**
     * 自定义角色id
     */
    private Long roleId;

    /**
     * 自定义操作id
     */
    private Long operationId;

    @ManyToOne(fetch = FetchType.EAGER)
    @NotFound(action= NotFoundAction.IGNORE)
    @JoinColumn(name = "operationId", referencedColumnName="id", insertable = false, updatable = false)
    private AuthorityMenuOperationVo authorityMenuOperationVo;


    /**
     *
     * @mbggenerated Fri Dec 16 12:30:03 CST 2022
     */
    private static final long serialVersionUID = 1L;
}
